#include "main.h"

TPoint::TPoint(void)
{
	_x=0;
	_y=0;
	_z=0;
}

TPoint::TPoint(double x, double y, double z)
{
	_x=x;
	_y=y;
	_z=z;
}


TPoint::~TPoint(void)
{
}

TPoint TPoint::add(TPoint p1,TPoint p2)
{
	return TPoint(p1._x+p2._x,p1._y+p2._y,p1._z+p2._z);
}

TPoint TPoint::inverse()
{
	return TPoint(-_x,-_y,-_z);
}



TPoint TPoint::lerp(TPoint p2,float timeStep)
{
	TPoint p1=TPoint(_x,_y,_z);

	TPoint delta=p2+p1.inverse();
	delta._x=delta._x*timeStep;
	delta._y=delta._y*timeStep;
	delta._z=delta._z*timeStep;
	
	return p1+delta;
}

